package com.hpq.user.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hpq.user.domain.model.UserEmoji;
import com.hpq.user.domain.vo.response.user.UserEmojiResp;
import com.hpq.user.mapper.UserEmojiMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserEmojiDAO extends ServiceImpl<UserEmojiMapper, UserEmoji> {
    public int countByUid(Long uid) {
        return lambdaQuery().eq(UserEmoji::getUid, uid).count();
    }

    public int countByUrl(String expressionUrl, Long uid) {
        return lambdaQuery().eq(UserEmoji::getExpressionUrl, expressionUrl)
                .eq(UserEmoji::getUid, uid)
                .count();
    }

    public List<UserEmoji> listByUid(Long uid) {
        return lambdaQuery().eq(UserEmoji::getUid, uid).list();
    }
}
